import request from '@/http'

// getTotalRecords
export const get_total_records = () => {
    return request({
        url: '/user-management/get-total-records',
        method: 'get'
    })
}

// handlePageChange
export const handle_page_change = (page, pageSize) => {
    return request({
        url: '/user-management/members-page-change',
        method: 'post',
        data: {
            page: page,
            pageSize: pageSize
        } 
    })
}

// handleEdit
export const handle_edit = (editUser) => {
    return request({
        url: '/user-management/edit-user',
        method: 'post',
        data: editUser
    })
}

// delIndex
export const handle_del = (index) => {
    return request({
        url: '/user-management/del-user',
        method: 'post',
        data: {
            id: index
        }
    })
}

// handleView
export const handle_view = (index) => {
    return request({
        url: '/user-management/view-user',
        method: 'post',
        data: {
            id: index
        }
    })
}

// getUserCards
export const get_user_cards = (index) => {
    return request({
        url: '/user-management/get-user-cards',
        method: 'post',
        data: {
            id: index
        }
    })
}

// handleStatusChange
export const handle_status_change = (index) => {
    return request({
        url: '/card-management/change-status',
        method: 'post',
        data: {
            id: index
        }
    })
}

// getClassRecords
export const get_class_records = (index) => {
    return request({
        url: '/course-management/get-class-records',
        method: 'post',
        data: {
            id: index
        }
    })
}

// getConsumeRecords
export const get_consume_records = (index) => {
    return request({
        url: '/course-management/get-consume-records',
        method: 'post',
        data: {
            id: index
        }
    })
}

// saveOnly
export const save_only = (form) => {
    return request({
        url: '/user-management/save-user',
        method: 'post',
        data: form
    })
}

// confirm
export const confirm_message = (form) => {
    return request({
        url: '/card-management/card-bind',
        method: 'post',
        data: form
    })
}

// handleGetCards
export const handle_get_cards = () => {
    return request({
        url: '/card-management/get-cards',
        method: 'get'
    })
}

// getResRecords
export const get_res_records = (index) => {
    return request({
        url: '/course-management/get-res-records',
        method: 'post',
        data: {
            id: index
        }
    })
}

// getUserMes
export const getUserMes = () => {
    return request({
        url: '/user-management/get-user-mes',
        method: 'get'
    })
}

// getTotalCards
export const get_total_cards = () => {
    return request({
        url: '/card-management/get-total-cards',
        method: 'get'
    })
}

// handleCardPageChange
export const handle_card_page_change = (page, pageSize) => {
    return request({
        url: '/card-management/handle-card-page-change',
        method: 'post',
        data: {
            page: page,
            pageSize: pageSize
        } 
    })
}

// getCourses
export const get_courses = () => {
    return request({
        url: '/course-management/get-courses',
        method: 'get'
    })
}

// sendCardMes
export const send_card_mes = (form) => {
    return request({
        url: '/card-management/send-card-mes',
        method: 'post',
        data: form
    })
}

// getCardCourse
export const get_card_course = (index) => {
    return request({
        url: '/course-management/get-card-course',
        method: 'post',
        data: {
            id: index
        }
    })
}